Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

143
Vistas
Javascript Insert text inside "<>" input

How i can insert dinamically something like "refer" inside my <> input tag, without writing it directly into html but using javascript? Something similar to

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

you can use setAttribute for this action

var i = document.querySelector("input");

i.setAttribute("name", "myinput");

ref: https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute

about 4 years ago · Juan Pablo Isaza Denunciar

0

Supposing you have this 👇

<input type="text" value="23" id="age"> </input>

You can select that element by

const ageInput = document.getElementById('age');

If what you want is to change the text inside you can do this by

ageInput.innerHTML = "Hello World"

Or you can set a new attribute by

ageInput.setAttribute("refer", "true");

setAttribute documentation 👉 https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda